package errcode

import "errors"

// 公共错误码
var (
	Success                   = NewError(0, "成功")
	SerVerError               = NewError(10000000, "服务内部错误")
	InvalidParams             = NewError(10000001, "入参错误")
	NotFound                  = NewError(10000002, "找不到")
	UnauthorizedAuthNotExist  = NewError(10000003, "鉴权失败，找不到对应的AppKey和AppSecret")
	UnauthorizedTokenError    = NewError(10000004, "鉴权失败, Token错误")
	UnauthorizedTokenTimeout  = NewError(10000005, "鉴权失败，Token超时")
	UnauthorizedTokenGenerate = NewError(10000006, "鉴权失败，Token生成失败")
	TooManyRequests           = NewError(10000007, "请求过多")
	QueryException            = NewError(10000008, "查询异常")
)

const (
	ID    = "id"
	MTYPE = "M" // 目录类型
	CTYPE = "C" // 菜单
	FTYPE = "F" // 按钮
	ATYPE = "A" // 接口
)

var (
	ErrList   = "获取列表失败"
	ErrCreate = "创建失败"
	ErrGet    = "获取失败"
	ErrEdit   = "修改失败"
	ErrDelete = "删除失败"
	ErrLogin  = "登录失败"
	ErrSerVer = "服务内部错误"
	ErrUpload = "上传失败"
)

var (
	ErrDictExist  = errors.New("字典已存在")
	ErrDictCreate = errors.New("创建字典失败")
	ErrDictGet    = errors.New("获取字典失败")
)
